package day05;

public class Animal {
    String name;
    int age;
    String color;
    Animal(String name,int age,String color){
        this.name = name;
        this.age = age;
        this.color = color;
    }
    void drink(){
        System.out.println(color+"色的"+age+"岁的"+name+"正在喝水...");
    }
    void eat(){
        System.out.println(color+"色的"+age+"岁的"+name+"正在吃饭...");
    }
}

class Dog extends Animal {
    Dog(String name,int age,String color){
        super(name,age,color);
    }
    void lookHome(){
        System.out.println(color+"色的"+age+"岁的狗狗"+name+"正在看家...");
    }
    void eat(){
        System.out.println(color+"色的"+age+"岁的狗狗"+name+"正在吃肯头...");
    }
}

 class Chick extends Animal {
    Chick(String name,int age,String color){
        super(name,age,color);
    }
    void layEggs(){
        System.out.println(color+"色的"+age+"岁的小鸡"+name+"正在下蛋...");
    }
    void eat(){
        System.out.println(color+"色的"+age+"岁的小鸡"+name+"正在吃小米...");
    }
}

 class Fish extends Animal {
    Fish(String name,int age,String color){
        super(name,age,color);
    }
    void eat(){
        System.out.println(color+"色的"+age+"岁的小鱼"+name+"正在吃小虾...");
    }
}

 class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑",2,"黑");
        dog.eat();
        dog.drink();
        dog.lookHome();

        Chick chick = new Chick("花花",3,"棕");
        chick.eat();
        chick.drink();
        chick.layEggs();

        Fish fish = new Fish("金金",1,"金");
        fish.eat();
        fish.drink();
    }
}